return {
  "neovim/nvim-lspconfig",
  dependencies = { "hrsh7th/cmp-nvim-lsp" },
  config = function()
    vim.keymap.set('n', '<leader>td', function()
      if vim.diagnostic.is_disabled() then
        vim.diagnostic.enable()
      else
        vim.diagnostic.disable()
      end
    end, { desc = '切换诊断显示' })

    vim.keymap.set('n', ']g', function() vim.diagnostic.goto_next() end)
    vim.keymap.set('n', '[g', function() vim.diagnostic.goto_prev() end)

    vim.keymap.set('n', 'gd', function() vim.lsp.buf.definition() end)
    vim.keymap.set('n', 'gh', function() vim.lsp.buf.hover() end)
    vim.keymap.set('n', 'gr', function() vim.lsp.buf.references() end)
    vim.keymap.set('n', 'gi', function() vim.lsp.buf.incoming_calls() end)

    vim.keymap.set('n', '<leader>rn', function() vim.lsp.buf.rename() end)
    vim.keymap.set('n', '<leader>ca', function() vim.lsp.buf.code_action() end)

    vim.api.nvim_command [[ hi def link LspReferenceText CursorLine ]]

    local lspconfig = require("lspconfig")
    local capabilities = require("cmp_nvim_lsp").default_capabilities()

    lspconfig.pyright.setup({
      capabilities = capabilities,
      settings = {
        pyright = {
          reportGeneralTypeIssues = false,
          reportUnknownArgumentType = false,
        },
      },
    })
    on_attach = function(client)
      -- [[ other on_attach code ]]
      require 'illuminate'.on_attach(client)
    end

    -- lspconfig.clangd.setup({
    --   capabilities = capabilities,
    -- })
  end,
}
